home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / thinkref / archive / THINKPascalUH2.1.sea / THINKPas Univ Hdr 2.1 / Interfaces / ENET.p < prev    next >
Text File  |  1995-09-12  |  4KB  |  116 lines

  1. { Converted with MPW2TPas Tuesday, September 12, 1995 5:56:57 PM }
  2. {
  3.      File:        ENET.p
  4.  
  5.      Contains:    Ethernet Interfaces.
  6.  
  7.      Version:    Technology:    System 7.5
  8.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  9.  
  10.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  14.                  stack.  Include the file and version information (from above)
  15.                  in the problem description and send to:
  16.                      Internet:    apple.bugs@applelink.apple.com
  17.                      AppleLink:    APPLE.BUGS
  18.  
  19. }
  20.  
  21.  UNIT ENET;
  22.  INTERFACE
  23.  
  24.  
  25. {$IFC UNDEFINED __ENET__}
  26. {$SETC __ENET__ := 1}
  27.  
  28.   USES
  29.    ConditionalMacros, Types, OSUtils;
  30.  
  31. { $PUSH}
  32. { $ALIGN MAC68K}
  33. { $LibExport+}
  34.  
  35. CONST
  36.     ENetSetGeneral                = 253;                            {Set "general" mode}
  37.     ENetGetInfo                    = 252;                            {Get info}
  38.     ENetRdCancel                = 251;                            {Cancel read}
  39.     ENetRead                    = 250;                            {Read}
  40.     ENetWrite                    = 249;                            {Write}
  41.     ENetDetachPH                = 248;                            {Detach protocol handler}
  42.     ENetAttachPH                = 247;                            {Attach protocol handler}
  43.     ENetAddMulti                = 246;                            {Add a multicast address}
  44.     ENetDelMulti                = 245;                            {Delete a multicast address}
  45.     EAddrRType                    = 'eadr';
  46.  
  47.     
  48. TYPE
  49.     EParamBlkPtr = ^EParamBlock;
  50.  
  51.     {
  52.         ENETCompletionProcPtr uses register based parameters on the 68k and cannot
  53.         be written in or called from a high-level language without the help of
  54.         mixed mode or assembly glue.
  55.  
  56.         In:
  57.          => thePBPtr        A0.L
  58.     }
  59.     ENETCompletionProcPtr = Register68kProcPtr;  { register PROCEDURE ENETCompletion(thePBPtr: EParamBlkPtr); }
  60.     ENETCompletionUPP = UniversalProcPtr;
  61.  
  62.     EParamBlock = PACKED RECORD
  63.         qLink:                    ^QElem;                                    {General EParams}
  64.         qType:                    INTEGER;                                {queue type}
  65.         ioTrap:                    INTEGER;                                {routine trap}
  66.         ioCmdAddr:                Ptr;                                    {routine address}
  67.         ioCompletion:            ENETCompletionUPP;                        {completion routine}
  68.         ioResult:                OSErr;                                    {result code}
  69.         ioNamePtr:                StringPtr;                                {->filename}
  70.         ioVRefNum:                INTEGER;                                {volume reference or drive number}
  71.         ioRefNum:                INTEGER;                                {driver reference number}
  72.         csCode:                    INTEGER;                                {Call command code}
  73.         CASE INTEGER OF
  74.         0: (
  75.             eProtType:                    INTEGER;                            {Ethernet protocol type}
  76.             ePointer:                    Ptr;                                {No support for PowerPC code}
  77.             eBuffSize:                    INTEGER;                            {buffer size}
  78.             eDataSize:                    INTEGER;                            {number of bytes read}
  79.            );
  80.         1: (
  81.             eMultiAddr:                    PACKED ARRAY [0..5] OF Byte;        {Multicast Address}
  82.            );
  83.     END;
  84.  
  85. CONST
  86.     uppENETCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  87.  
  88. PROCEDURE CallENETCompletionProc(thePBPtr: EParamBlkPtr; userRoutine: ENETCompletionUPP);
  89.     {$IFC NOT GENERATINGCFM}
  90.     {To be implemented:  Glue to move parameters into registers.}
  91.     {$ENDC}
  92.  
  93. FUNCTION NewENETCompletionProc(userRoutine: ENETCompletionProcPtr): ENETCompletionUPP;
  94.     {$IFC NOT GENERATINGCFM }
  95.     INLINE $2E9F;
  96.     {$ENDC}
  97.  
  98. FUNCTION EWrite(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  99. FUNCTION EAttachPH(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  100. FUNCTION EDetachPH(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  101. FUNCTION ERead(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  102. FUNCTION ERdCancel(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  103. FUNCTION EGetInfo(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  104. FUNCTION ESetGeneral(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  105. FUNCTION EAddMulti(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  106. FUNCTION EDelMulti(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  107.  
  108. { $ALIGN RESET}
  109. { $POP}
  110.  
  111. {$ENDC} {__ENET__}
  112.  
  113.  IMPLEMENTATION
  114.  END.
  115.  
  116.